package com.beta.service.impl;

import com.beta.event.ShopPayloadEvent;
import com.beta.event.ShopEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

/**
 * Created by vector on 2016/12/7.
 */
@Service
public class PublishService {

    @Autowired
    private ApplicationEventPublisher eventPublisher;

    public void publishApplicationEvent(ShopEvent event) {
        eventPublisher.publishEvent(event);
    }

    public void publishApplicationEvent(ShopPayloadEvent<? extends ShopEvent, ?> payloadEvent) {
        eventPublisher.publishEvent(payloadEvent);
    }

}
